//
//  Strategy.m
//  Full_House
//
//  Created by 张忱 on 15-6-3.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "Strategy.h"

@implementation Strategy

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"photos"]) {
        
        self.image = [NSString stringWithFormat:@"http://gooju.cn/dimages/%@_0_w213_h213_m0.jpg", [[value firstObject] objectForKey:@"id"]];
    }
    if ([key isEqualToString:@"user"]) {
        self.userName = [value objectForKey:@"userName"];
        NSLog(@"%@", self.userName);
    }
    if ([key isEqualToString:@"description"]) {
        self.des = value;
    }
    if ([key isEqualToString:@"id"]) {
        self.detailID = value;
    }
    
    
    
}

+ (NSMutableArray *)strategyArrWithDicArr:(NSArray *)dicArr
{
    NSMutableArray *arr =[NSMutableArray array];
    
    for (NSDictionary *dic in dicArr) {
        Strategy *strategy = [[Strategy alloc] init];
        [strategy setValuesForKeysWithDictionary:dic];
        
        [arr addObject:strategy];
        [strategy release];
    
        
    }
    
    return arr;
    
}
- (void)dealloc
{
    [_title release];
    [_date release];
    [_userName release];
    [_des release];
    [_image release];
    [super dealloc];
}



@end
